package com.zhuiyun.project.api.personmessage.service;

import com.zhuiyun.project.api.personmessage.entity.PersonMessage;
import com.zhuiyun.project.api.personmessage.model.PersonMessageModel;
import com.zhuiyun.project.common.response.CommonResult;

/**
 * @ClassName PersonService
 * @Description TODO
 * @Author kdj
 * @Date 2023/6/27 14:29
 **/
public interface PersonMessageService {
    /**
     * @param personMessageModel
     * @Author kdj
     * @Description 撤回消息
     * @Date 2023/7/18 15:18
     * @Return int
     */
    int recallMsg(PersonMessageModel personMessageModel);

    /**
     * @param personMessageModel
     * @Author kdj
     * @Description 添加聊天记录
     * @Date 2023/6/27 14:36
     * @Return int
     */
    int insertPerMsg(PersonMessageModel personMessageModel);

    /**
     * @param fromId
     * @param toId
     * @Author kdj
     * @Description 获取单聊的聊天记录
     * @Date 2023/6/27 19:10
     * @Return com.zhuiyun.project.common.response.CommonResult
     */
    CommonResult getChatRecord(int fromId, int toId);

    /**
     * @param fromId
     * @param toId
     * @Author kdj
     * @Description 清空未读信息
     * @Date 2023/6/28 15:39
     * @Return com.zhuiyun.project.common.response.CommonResult
     */
    CommonResult cleanUnReadMsg(int fromId, int toId);

    /**
     * @param fromId
     * @param toId
     * @Author kdj
     * @Description 发送添加成功后的第一条消息
     * @Date 2023/6/29 9:05
     * @Return boolean
     */
    boolean sendFirstMsg(int fromId, int toId);


    /**
     * @param fromId
     * @param toId
     * @Author kdj
     * @Description 获取该聊天内容中最后一条消息
     * @Date 2023/7/19 9:48
     * @Return com.zhuiyun.project.api.personmessage.entity.PersonMessage
     */
    PersonMessage getMsgIsLast(int fromId, int toId);

    /**
     * @param personMessage
     * @param fromId
     * @Author kdj
     * @Description 删除消息
     * @Date 2023/7/20 15:00
     * @Return int   0失败 1成功
     */
    int upDelMsg(PersonMessage personMessage, int fromId);

    /**
     * @param fromId
     * @param toId
     * @Author kdj
     * @Description 获取单聊聊天内容中最后一条消息（删除之后）
     * @Date 2023/7/19 9:48
     * @Return com.zhuiyun.project.api.personmessage.entity.PersonMessage
     */
    PersonMessage getMsgLastInfo(int fromId, int toId,int userId);
}
